/**
 * @memberOf emp
 */
emp.configManager = (function () {
	/* Declare private varibles and functions here */
	var controllerURL = "mapengine/config";
	var mapConfigURL  = controllerURL + "/getMapConfiguration";

	/* Configuration setting vars and functions*/
	function getConfig(isSync) {
		emp.$.ajax({
			type: "GET",
			url: mapConfigURL,
			success: function (data) {
				emp.configManager = data;
			},
			failure: function (data) {
				alert("FAILURE could NOT find map configuration");
			},
			async: isSync
		});
	}
	
	function load(isSync) {
		if (typeof isSync === 'undefined' || isSync == '' || isSync == null) {
			isSync = false;
		}
		getConfig(isSync);
	}
	/* End private space */

	// Declare public functions and varibales within the publicInterface object
	//   this object is returned as emp.configManager 
	var publicInterface = {
		/**
		 * @function
		 * @param isSync
		 *            boolean that dictates if the object will be built  asynchronously
		 * @desc Provides a Synchronous method -- blocks thread until object is fully populated.
		 * 		 Asnychronous method -- non-blocking, object is populated when async callbacks
		 * 		 are completed successfully.
		 *       False by default.
		 */
		getInstance: function (isSync) {
			load(isSync);
		}
	};
	return publicInterface;
}());